FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g04a5cb3.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g04a5cb3.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=04a5cb3 OS_GIT_VERSION=4.10.0-202202160023.p0.g04a5cb3.assembly.stream-04a5cb3 SOURCE_DATE_EPOCH=1643210776 SOURCE_GIT_COMMIT=04a5cb352bd086a12436b6d2683d5b1bc99c39bc SOURCE_GIT_TAG=04a5cb3 SOURCE_GIT_URL=https://github.com/openshift/image-customization-controller 
WORKDIR /go/src/github.com/openshift/image-customization-controller
COPY . .
RUN CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o bin/image-customization-controller cmd/controller/main.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o bin/image-customization-server cmd/static-server/main.go

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g04a5cb3.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g04a5cb3.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=04a5cb3 OS_GIT_VERSION=4.10.0-202202160023.p0.g04a5cb3.assembly.stream-04a5cb3 SOURCE_DATE_EPOCH=1643210776 SOURCE_GIT_COMMIT=04a5cb352bd086a12436b6d2683d5b1bc99c39bc SOURCE_GIT_TAG=04a5cb3 SOURCE_GIT_URL=https://github.com/openshift/image-customization-controller 
COPY --from=builder /go/src/github.com/openshift/image-customization-controller/bin/image-customization-controller /
COPY --from=builder /go/src/github.com/openshift/image-customization-controller/bin/image-customization-server /
RUN dnf install -y nmstate

LABEL \
        name="openshift/ose-image-customization-controller" \
        com.redhat.component="ose-image-customization-controller-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Bare Metal Hardware Provisioning" \
        io.openshift.maintainer.subcomponent="OS Image Provider" \
        release="202202160023.p0.g04a5cb3.assembly.stream" \
        io.openshift.build.commit.id="04a5cb352bd086a12436b6d2683d5b1bc99c39bc" \
        io.openshift.build.source-location="https://github.com/openshift/image-customization-controller" \
        io.openshift.build.commit.url="https://github.com/openshift/image-customization-controller/commit/04a5cb352bd086a12436b6d2683d5b1bc99c39bc" \
        version="v4.10.0"

